package beauty.other;

import java.util.HashSet;
import java.util.Set;

/**
 * 推理
 * Created by Robo on 2018/1/31.
 */
public class LogicReasoning {

    public static void main(String[] args) {
//        char c = 96;
//        System.out.println(c);
//        murder();
        diving();
    }

    public static void murder() {
        //列举所有可能
        for (int i = 0; i < 4; i++) {
            boolean[] men = {false, false, false, false};
            men[i] = true;
            if (calcB(men[0] == false) + calcB(men[2] == true) + calcB(men[3] == true) + calcB(men[3] == false) == 3) {
                System.out.println(i);
            }
        }
    }

    public static void diving () {
        String[] rank = new String[]{"a", "b", "c", "d", "e"};
        for (int a = 0; a < 5; a++) {
            for (int b = 0; b < 5; b++) {
                for (int c = 0; c < 5; c++) {
                    for (int d = 0; d < 5; d++) {
                        for (int e = 0; e < 5; e++) {
                            if ((calcB(b == 0) + calcB(a != 2) == 1)
                                &&(calcB(b == 1) + calcB(e != 3) == 1)
                                &&(calcB(c == 0) + calcB(d != 1) == 1)
                                &&(calcB(c == 4) + calcB(d != 2) == 1)
                                &&(calcB(e == 3) + calcB(a != 1) == 1)
                                ) {
                                Set<Integer> removalDuplicateDuplicate = new HashSet<>();
                                removalDuplicateDuplicate.add(a);
                                removalDuplicateDuplicate.add(b);
                                removalDuplicateDuplicate.add(c);
                                removalDuplicateDuplicate.add(d);
                                removalDuplicateDuplicate.add(e);
                                if (removalDuplicateDuplicate.size() == 5) {
                                    System.out.println(a);
                                    System.out.println(b);
                                    System.out.println(c);
                                    System.out.println(d);
                                    System.out.println(e);
                                    return;
                                }
                            }


                        }
                    }
                }
            }

        }


    }
    public static int calcB(boolean b) {
        return b ? 1 : 0;
    }
}
